package com.alibaba.datax.elasticresource.watcher;

import com.alibaba.datax.common.util.Configuration;

/**
 * @类名: WatcherConfigKey
 * @说明: watcher配置项key
 *
 * @author   leehom
 * @Date	 2022年4月27日 下午2:49:13
 * 修改记录：
 *
 * @see 	 
 */
public final class WatcherConfigKey {
	
	public static final String PREFIX = "";
	
	// summary
    public static String summaryReportType(Configuration conf) {
        return conf.getString("type");
    }
	
	// elasticsearch
    public static String elasticsaerchNodes(Configuration conf) {
        return conf.getString("nodes", "localhost:9200");
    }
    
    public static String elasticsaerchSchemaConfPath(Configuration conf) {
        return conf.getString("schemaConfPath");
    }
    
    public static String elasticsaerchIndex(Configuration conf) {
        return conf.getString("index");
    }
	
    // snapshot
    public static String snapshotReportType(Configuration conf) {
        return conf.getString("type");
    }
    // redis
    // 类型，standalone/sentinel/cluster
    public static String redisClientType(Configuration conf) {
        return conf.getString("type", "standalone");
    }
    
    public static String redisClientKeyPrefix(Configuration conf) {
        return conf.getString("keyPrefix");
    }
    
    public static long redisClientExpireTime(Configuration conf) {
        return conf.getLong("expireTime", 300L);
    }
    
    public static String redisClientNodes(Configuration conf) {
        return conf.getString("nodes", "");
    }
    
    public static int redisClientDatabase(Configuration conf) {
        return conf.getInt("database", 0);
    }

    public static String redisClientPassword(Configuration conf) {
        return conf.getString("password", "");
    }
    
    public static String redisClientMaster(Configuration conf) {
        return conf.getString("sentinel.master", "");
    }
    
    // pool
    // ...
}
